<!DOCTYPE html>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <title>主题选择</title>
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html"/>
    <![endif]-->
    <link rel="shortcut icon" href="../static/favicon.ico" th:href="@{favicon.ico}"/>
    <!-- fileinput文件上传插件 -->
    <link th:href="@{/ajax/libs/bootstrap-fileinput/fileinput.min.css?v=5.5.2}" rel="stylesheet"/>
    <link th:href="@{/css/bootstrap.min.css?v=3.3.7}" rel="stylesheet"/>
    <link th:href="@{/css/font-awesome.min.css?v=4.7.0}" rel="stylesheet"/>
    <link th:href="@{/css/style.min.css?v=20210831}" rel="stylesheet"/>
    <link th:href="@{/ruoyi/css/ry-ui.css?v=4.7.7}" rel="stylesheet"/>
</head>
<body class="gray-bg">
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-software-add">
        <div class="form-group">
            <div class="col-sm-12">
                <input type="hidden" name="updateFile">
                <div class="file-loading">
                    <input class="form-control file-upload" id="updateFile" name="file" type="file">
                </div>
            </div>
        </div>
        <div class="form-group">
            拖拽或者点击选择图片, 最后点击上传图片图标完成上传
        </div>
    </form>
</div>
<script th:src="@{/js/jquery.min.js?v=3.6.3}"></script>
<script th:src="@{/js/bootstrap.min.js?v=3.3.7}"></script>
<script th:src="@{/ajax/libs/bootstrap-fileinput/fileinput.min.js?v=5.5.2}"></script>
<script th:inline="javascript"> var ctx = [[@{/}]]; var captchaType = [[${captchaType}]]; </script>
<script th:inline="javascript">
    $(".file-upload").fileinput({
        uploadUrl: ctx + 'common/upload',
        maxFileCount: 1,
        autoReplace: true,
        showRemove: false,
        showUpload: false,
        showCancel: false,
        showBrowse: false,
        browseOnZoneClick: true,
        showCaption: false
    }).on('fileuploaded', function (event, data, previewId, index) {
        $("input[name='" + event.currentTarget.id + "']").val(data.response.url);
        var rsp = data.response;
        $.ajax({
            url: ctx + 'system/config/backgroundImgSave?imageUrl=' + data.response.url,
            success: function(data) {
                if (data.code == 0) {
                    alert("保存成功!");
                } else {
                    alert("保存失败, 请重试!");
                }
            }
        });
    }).on('fileremoved', function (event, id, index) {
        $("input[name='" + event.currentTarget.id + "']").val('');
    });
</script>
</body>
</html>
